﻿namespace EFS.RC.SupervisorCentral.Common.Config.Sections.Monitoring
{
	/// Reads All section
	public class All
	{
		// all
		private static System.Collections.Generic.Dictionary<System.String, EFS.RC.SupervisorCentral.Common.Config.Sections.Monitoring.Thresholds.All>
			allThresholds = new System.Collections.Generic.Dictionary<string, Thresholds.All>();

		/// Static constructor
		static All()
		{
			Instance = new All();
		}

		/// Property Instance: Get, Set
		public static EFS.RC.SupervisorCentral.Common.Config.Sections.Monitoring.All Instance { get; private set; }

		/// <summary>
		/// Get all
		/// </summary>
		/// <param name="phoneUri"></param>
		/// <returns></returns>
		public EFS.RC.SupervisorCentral.Common.Config.Sections.Monitoring.Thresholds.All GetForThePhone(System.String phoneUri)
		{
			// get existing
			if (allThresholds.ContainsKey(phoneUri))
			{
				return allThresholds[phoneUri];
			}

			// make new
			EFS.RC.SupervisorCentral.Common.Config.Sections.Monitoring.Thresholds.All phoneThresholds = new Thresholds.All(phoneUri);
			allThresholds[phoneUri] = phoneThresholds;
			return phoneThresholds;
		}
	}

}